add_compile_options(-Wno-invalid-source-encoding) # 忽略 gbk 编码警告

cmake_minimum_required(VERSION 3.10)
project(appinstaller LANGUAGES CXX)  # 声明项目使用 C++
set(CMAKE_CXX_STANDARD 20)        # 指定 C++20
set(CMAKE_CXX_STANDARD_REQUIRED ON)  # 强制要求编译器支持 C++20
set(CMAKE_CXX_EXTENSIONS ON)     # 禁用编译器扩展（如 GNU 的 `-std=gnu++20`）

find_package(imgui CONFIG REQUIRED)

file(GLOB_RECURSE CPP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")

# 打印文件列表（调试用）
message(STATUS "Found CPP files: ${CPP_FILES}")

# 定义可执行文件
add_executable(${CMAKE_PROJECT_NAME} WIN32 ${CPP_FILES})

target_link_libraries(${CMAKE_PROJECT_NAME}
    PRIVATE
        d3d11.lib
        d3dcompiler.lib
        dxgi.lib
        dwmapi.lib
)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE imgui::imgui)

# 引入 DLL 拷贝逻辑
include(${CMAKE_CURRENT_SOURCE_DIR}/build_scripts/CopyDLLs.cmake)